// <editor-fold defaultstate="collapsed" desc="Đừng quan tâm"> 
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package gui.khachhang;

import gui.event.khachhang.KHSaoLuuDlg_evt;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JButton;

/**
 *
 * @author nv_ca
 */
public class KHSaoLuu_Dialog extends javax.swing.JDialog {

    /**
     * Creates new form KHSaoLuu
     */
    private List<JButton> listButtons;
    public KHSaoLuu_Dialog(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        this.setLocationRelativeTo(parent);
        this.listButtons = new ArrayList<JButton>();
        listButtons.add(this.btnChiTiet);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        listDanhSach = new javax.swing.JList();
        jLabel2 = new javax.swing.JLabel();
        btnChiTiet = new javax.swing.JButton();
        jLabel3 = new javax.swing.JLabel();
        txtDuongDan = new javax.swing.JTextField();
        btnDuyet = new javax.swing.JButton();
        ckboxLuuTepBaoCao = new javax.swing.JCheckBox();
        btnSaoLuu = new javax.swing.JButton();
        btnClose = new javax.swing.JButton();
        btnChucNangDayDu = new javax.swing.JButton();
        btnXoaKhoiDS = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Sao Lưu Khách Hàng");

        listDanhSach.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Khách hàng A", "Khách hàng B", "Nguyễn Văn Chúc Ân", "Đẹp trai nhất nhà nè" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        listDanhSach.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        listDanhSach.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
            public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
                listDanhSachValueChanged(evt);
            }
        });
        jScrollPane1.setViewportView(listDanhSach);

        jLabel2.setText("Danh Sách");

        btnChiTiet.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/images/ultility/View-Details-16.png"))); // NOI18N
        btnChiTiet.setText("Chi tiết...");
        btnChiTiet.setEnabled(false);
        btnChiTiet.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnChiTietActionPerformed(evt);
            }
        });

        jLabel3.setText("Đường dẫn");

        txtDuongDan.setText("C:\\User\\nv_ca\\KhachHang_SaoLuu");

        btnDuyet.setText("Duyệt...");
        btnDuyet.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDuyetActionPerformed(evt);
            }
        });

        ckboxLuuTepBaoCao.setSelected(true);
        ckboxLuuTepBaoCao.setText("Lưu tệp báo cáo");

        btnSaoLuu.setText("Sao Lưu");
        btnSaoLuu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSaoLuuActionPerformed(evt);
            }
        });

        btnClose.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/images/ultility/Close-16.png"))); // NOI18N
        btnClose.setText("Đóng");
        btnClose.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCloseActionPerformed(evt);
            }
        });

        btnChucNangDayDu.setText("Chức năng đầy đủ...");
        btnChucNangDayDu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnChucNangDayDuActionPerformed(evt);
            }
        });

        btnXoaKhoiDS.setText("Xóa khỏi DS");
        btnXoaKhoiDS.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnXoaKhoiDSActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel2)
                            .addComponent(jLabel3))
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(ckboxLuuTepBaoCao)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(txtDuongDan, javax.swing.GroupLayout.DEFAULT_SIZE, 234, Short.MAX_VALUE)
                                    .addComponent(jScrollPane1))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(btnChiTiet)
                                    .addComponent(btnDuyet)
                                    .addComponent(btnXoaKhoiDS)))))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(8, 8, 8)
                        .addComponent(btnChucNangDayDu)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btnSaoLuu)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnClose)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {btnChiTiet, btnDuyet, btnXoaKhoiDS});

        layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {btnClose, btnSaoLuu});

        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(51, 51, 51)
                        .addComponent(jLabel2))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(46, 46, 46)
                        .addComponent(btnChiTiet)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnXoaKhoiDS))
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(txtDuongDan, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnDuyet))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(ckboxLuuTepBaoCao)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnSaoLuu)
                    .addComponent(btnClose)
                    .addComponent(btnChucNangDayDu, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {btnChucNangDayDu, btnSaoLuu});

        pack();
    }// </editor-fold>//GEN-END:initComponents
//</editor-fold> 
    private void btnChucNangDayDuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnChucNangDayDuActionPerformed
        KHSaoLuuDlg_evt.btnChucNangDayDuActionPerformed(this);
    }//GEN-LAST:event_btnChucNangDayDuActionPerformed

    private void btnChiTietActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnChiTietActionPerformed
       KHSaoLuuDlg_evt.btnChiTietActionPerformed();
    }//GEN-LAST:event_btnChiTietActionPerformed

    private void btnXoaKhoiDSActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnXoaKhoiDSActionPerformed
        KHSaoLuuDlg_evt.btnXoaKhoiDSActionPerformed(listDanhSach);
    }//GEN-LAST:event_btnXoaKhoiDSActionPerformed

    private void btnSaoLuuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaoLuuActionPerformed
       KHSaoLuuDlg_evt.btnSaoLuuActionPerformed();
    }//GEN-LAST:event_btnSaoLuuActionPerformed

    private void btnCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCloseActionPerformed
        KHSaoLuuDlg_evt.btnCloseActionPerformed(this);
    }//GEN-LAST:event_btnCloseActionPerformed

    private void listDanhSachValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_listDanhSachValueChanged
        KHSaoLuuDlg_evt.listDanhSachValueChanged(this.listButtons);
    }//GEN-LAST:event_listDanhSachValueChanged

    private void btnDuyetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDuyetActionPerformed
        txtDuongDan.setText(KHSaoLuuDlg_evt.btnDuyetActionPerformed());
    }//GEN-LAST:event_btnDuyetActionPerformed
// <editor-fold defaultstate="collapsed" desc="Đừng quan tâm"> 
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(KHSaoLuu_Dialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(KHSaoLuu_Dialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(KHSaoLuu_Dialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(KHSaoLuu_Dialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the dialog */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                KHSaoLuu_Dialog dialog = new KHSaoLuu_Dialog(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    @Override
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnChiTiet;
    private javax.swing.JButton btnChucNangDayDu;
    private javax.swing.JButton btnClose;
    private javax.swing.JButton btnDuyet;
    private javax.swing.JButton btnSaoLuu;
    private javax.swing.JButton btnXoaKhoiDS;
    private javax.swing.JCheckBox ckboxLuuTepBaoCao;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JList listDanhSach;
    private javax.swing.JTextField txtDuongDan;
    // End of variables declaration//GEN-END:variables
}
//</editor-fold>